import Mixins from '@/views/mixins'
import stock from '@/api/eims/stockAPI'
export default {
  mixins: [Mixins],
  created () {
    this.initPageList()
  },
  methods: {
    getRequestType (opt) {
      if (this.id === 'product_entry') {
        return stock.getProductStorageListAPI
      } else if (this.id === 'product_out') {
        return stock.getProductDeliveryListAPI
      } else if (this.id === 'product_storage') {
        if (opt === 'update') {
          return stock.updateProductInventoryAPI
        }
        return stock.getProductInventoryListAPI
      } else if (this.id === 'warehouse_manage') {
        if (opt === 'delete') {
          return stock.deleteWarehouseAPI
        } else if (opt === 'update') {
          return stock.updateWarehouseAPI
        } else if (opt === 'add') {
          return stock.addWarehouseAPI
        }
        return stock.getWarehouseListAPI
      } else {
        if (opt === 'getProductStockLocked') {
          return stock.getProductStockLocked
        }
      }
    }
  }

}
